home *** CD-ROM | disk | FTP | other *** search
/ 500 MB Nyheder Direkte fra Internet 2 / 500 MB nyheder direkte fra internet CD 2.iso / start / data / text / faq-1035.txt < prev    next >
Text File  |  1995-05-02  |  61KB  |  1,161 lines

  1. Archive-name: object-faq/part1
  2. Last-Modified: 10/27/94
  3. Version: 1.0.7
  4.  
  5.  
  6. COMP.OBJECT FAQ
  7. Version: 1.0.7
  8. Date:    10/27/1994
  9.  
  10.  
  11. Author:
  12.   Bob Hathaway
  13.   Geodesic Systems, Inc.
  14.   Cyberdyne Systems Corporation
  15.   rjh@geodesic.com
  16.  
  17.  
  18. Anonymous FTP Sites and Hypertext Server:
  19.   anonymous@zaphod.uchicago.edu:/pub/CompObj7.faq(.Z)     (128.135.72.61)
  20.   anonymous@rtfm.mit.edu:/pub/usenet/comp.object/*_Part_* (18.181.0.24 Tmp)
  21.   http://iamwww.unibe.ch/~scg/OOinfo/FAQ/index.html       (new IAM location)
  22.  
  23. Mail Server:  (See also section 1.24)
  24.   mail mail-server@rtfm.mit.edu
  25.   Subject:
  26.   send usenet/comp.object/*
  27.  
  28. Zaphod is preferred over rtfm for anonymous ftp retrieval, as it provides a
  29. single file.  Rtfm contains the FAQ as posted.
  30.  
  31. To use the hypertext system, see APPENDIX E, entries 27.
  32. There is currently no comp.object archive.
  33.  
  34. Copyright 1992-1994  Bob Hathaway
  35. All rights reserved.
  36.  
  37. Permission is granted to freely copy and distribute this document but only
  38. with this full header attached and at no cost to others with the exception
  39. of a nominal distribution fee, if any.  No sale, resale or reprinting is
  40. granted without the explicit written permission of the author.
  41.  
  42. Contributors:  Per Abrahamsen, Edwardo Casais, Stewart Clamen, Dennis De
  43.   Champeaux, Mike DeVaney, Eric Dujardin, Piercarlo Grandi, Brian Henderson-
  44.   Sellers, Urs Hoelzle, Paul Johnson, Bill Kinnersley, Oscar Nierstrasz, 
  45.   James Odell, Eoin Woods, and many others whose contributions have helped this
  46.   document to fulfull its objective of bringing object-oriented concepts and
  47.   systems to everyone.
  48.   
  49.   Special thanks to Object Systems, Geodesic Systems and Cyberdyne Systems for
  50.   providing the support and resources needed to make this effort possible.
  51.  
  52. Objective:
  53.   In the spirit of other FAQs, to provide a simple document to answer the most
  54.   frequently asked and recurring questions and to allow new users to understand
  55.   frequently discussed topics and terms used in comp.object.   This should
  56.   bring new comp.object readers and/or writers to at least an introductory
  57.   level of comprehension as soon as possible.  Other goals (hopes) are to
  58.   provide a quick and current reference on available systems such as object-
  59.   oriented languages, CASE, OODB and etc. and to provide good references to
  60.   current and relevant OO systems, groups, texts and literature.
  61.  
  62. Disclaimer:
  63.   This document does not necessarily reflect the opinions of the author's or
  64.   any contributor's companies.  There are no explicit or implicit guarantees
  65.   implied by this document.
  66.  
  67. While object systems are a constantly changing and moving target with a broad
  68. diversity of often conflicting methodologies, constructs, terminologies,
  69. approaches, languages, implementations and etc. and comp.object has a wide
  70. diversity of readers and writers ranging from students, professors and
  71. researchers in academia to beginners, professionals, top-notch experts and
  72. leaders in industry with a broad range of experience and backgrounds ranging
  73. across many paradigms, this FAQ can certainly not aspire to satisfy all of them
  74. completely but instead attempts to provide the most well-rounded treatment of
  75. object-oriented concepts and realizations primarily from the mainstream and
  76. popular authors and systems and further to provide a collection of available
  77. systems and tools in the appendices.
  78.  
  79. Several improvements are planned for future FAQs, including a glossary.
  80.  
  81.  
  82. SECTION 1:  BASICS
  83.   1.1)  What Is An Object?
  84.   1.2)  What Is Object Encapsulation (Or Protection)?
  85.   1.3)  What Is A Class?
  86.   1.4)  What Is A Meta-Class?
  87.   1.5)  What Is The Infinite Regress Of Objects And Classes?
  88.   1.6)  What are MOPs and Reflection?
  89.   1.7)  What Is Inheritance?
  90.   1.8)  What Is Multiple Inheritance?
  91.   1.9)  Does Multiple Inheritance Pose Any Additional Difficulties?
  92.   1.10) What Is Dynamic Inheritance?
  93.   1.11) What Is Shared (Repeated) Inheritance?
  94.   1.12) Why Use Inheritance?
  95.   1.13) Why Don't Some People Like Inheritance?
  96.   1.14) What Is Specialization/Generalization/Overriding?
  97.   1.15) What Is The Difference Between Object-Based And Object-Oriented?
  98.   1.16) Is A Class An Object?
  99.   1.17) Is An Object A Class?
  100.   1.18) What Is A Method? (And Receiver And Message)
  101.   1.19) What Are Multi-Methods And Multiple-Polymorphism?
  102.   1.20) What Is OOP?
  103.   1.21) What Is OOA/OOD (And Where Can I Get What I Need On It)?
  104.   1.22) Where Did Object-Orientation Come From?
  105.   1.23) What Are The Benefits Of Object-Orientation?
  106.   1.24) What Other FAQs Are available?
  107.  
  108. SECTION 2:  TYPING
  109.   2.1)  What Is Polymorphism?
  110.   2.2)  What Does Polymorphism Boil Down To In OO Programming Languages?
  111.   2.3)  What Is Dynamic Binding?
  112.   2.4)  Is There A Difference Between Being A Member Or Instance Of A Class?
  113.   2.5)  What Is This I Read About ML And Functional Programming Languages?
  114.   2.6)  What Is the Difference Between Static And Dynamic Typing?
  115.   2.7)  What Is A Separation Between Type And Class (Representation)?
  116.   2.8)  What Are Generics And Templates?
  117.  
  118. SECTION 3:  GENERAL
  119.   3.1)  What Is The "Classical" Object-Oriented Paradigm?
  120.   3.2)  What Is The "Delegation/Prototyping" Object-Oriented Paradigm?
  121.   3.3)  Are There Any Other Object-Oriented Paradigms?
  122.   3.4)  What Are The Major Object-Oriented Programming Languages Today?
  123.   3.5)  What Are Object-Oriented Databases And Persistence?
  124.   3.6)  What Are Object-Oriented Operating Systems?
  125.   3.7)  What Are The Current Object-Oriented Methodologies?
  126.   3.8)  What Is The OMG/OMA/ORB/CORBA?
  127.   3.9)  Why Is Garbage Collection A Good Thing?
  128.   3.10) What Can I Do To Teach OO To The Kids?
  129.   3.11) What Is Available On Object-Oriented Testing?
  130.   3.12) What Distributed Systems Are Available?
  131.   3.13) What Is The MVC Framework?
  132.   3.14) What Is Real-Time?
  133.   3.15) What Is Available on OO Metrics?
  134.  
  135. SECTION 4:  COMMONLY ASKED LANGUAGE SPECIFIC QUESTIONS
  136.   4.1)  What Is Downcasting?
  137.   4.2)  What Are Virtual Functions?
  138.   4.3)  Can I Use Multiple-Polymorphism Or Multi-Methods In C++?
  139.   4.4)  Can I Use Dynamic Inheritance In C++?
  140.  
  141. ANNOTATED BIBLIOGRAPHY
  142.  
  143. APPENDIXES
  144.   APPENDIX A  VIPS
  145.   APPENDIX B  OBJECT-ORIENTED DATABASES AND VENDORS
  146.   APPENDIX C  OBJECT-ORIENTED LANGUAGES AND VENDORS
  147.   APPENDIX D  OBJECT-ORIENTED CASE (OOA/D/P TOOLS) AND VENDORS
  148.   APPENDIX E  ANONYMOUS FTP SITES
  149.   APPENDIX F  MAGAZINES, JOURNALS AND NEWSLETTERS
  150.  
  151. [Another appendix on miscellaneous commercial object-oriented systems should
  152.  be added soon for completeness]
  153.  
  154.  
  155. SECTION 1:  BASICS
  156. ==================
  157.  
  158. Suggested Readings:
  159.   [Booch 91, 94]
  160.   Others to be added...
  161.  
  162.  
  163. 1.1) What Is An Object?
  164. -----------------------
  165.  
  166. There are many definitions of an object, such as found in [Booch 91, p77]:
  167. "An object has state, behavior, and identity; the structure and behavior of
  168. similar objects are defined in their common class; the terms instance and
  169. object are interchangeable".  This is a "classical languages" definition, as
  170. defined in [Coplien 92, p280], where "classes play a central role in the
  171. object model", since they do not in prototyping/delegation languages.  
  172. "The term object was first formally applied in the Simula language, and
  173. objects typically existed in Simula programs to simulate some aspect of
  174. reality" [Booch 91, p77].  Other definitions referenced by Booch include
  175. Smith and Tockey: "an object represents an individual, identifiable item,
  176. unit, or entity, either real or abstract, with a well-defined role in the
  177. problem domain." and [Cox 91]: "anything with a crisply defined boundary"
  178. (in context, this is "outside the computer domain".  A more conventional
  179. definition appears on pg 54).  Booch goes on to describe these definitions
  180. in depth.  [Martin 92, p 241] defines: "An "object" is anything to which a
  181. concept applies", and "A concept is an idea or notion we share that applies
  182. to certain objects in our awareness".  [Rumbaugh 91] defines: "We define an
  183. object as a concept, abstraction or thing with crisp boundaries and meaning for
  184. the problem at hand." [Shlaer 88, p 14] defines: "An object is an abstraction
  185. of a set of real-world things such that:
  186.   * all of the real-world things in the set - the instances - have the same
  187.     characteristics
  188.   * all instances are subject to and conform to the same rules"
  189. and on identifying objects: "What are the *things* in this problem?  Most of
  190. the things are likely to fall into the following five categories: Tangible
  191. things, Roles, Incidents, Interactions, and Specifications."  [Booch 91, 4.3]
  192. covers "Identifying Key Abstractions" for objects and classes based on an
  193. understanding of the problem domain and [Jacobson 92] provides a novel approach
  194. to identifying objects through use-cases, leading to a use-case driven design.
  195. Jacobson also classifies objects into interface objects (e.g. GUI), entity
  196. objects (corresponding to real-world objects), and control objects (introduced
  197. in design).
  198.  
  199. The implementation of objects could roughly be categorized into descriptor-
  200. based, capability-based, and simple static-based approaches.  Descriptor-
  201. based approaches (e.g. Smalltalk handles) allow powerful dynamic typing, as
  202. do the capability-based approaches which are typically found in object-
  203. oriented databases and operating systems (object id's).  A "proxy" based
  204. approach with an added layer of indirection to Smalltalk's handles is found
  205. in Distributed Smalltalk which allows transparent, distributed, and migrating
  206. objects [Kim 89, ch 19 and Yaoqing 93].  Simple static approaches are found in
  207. languages such as C++, although the new RTTI facility will supply simple
  208. dynamic typing similar to those introduced by Eiffel in 1989 through the notion
  209. of assignment attempt.
  210.  
  211. Descriptor-based approaches can have pointer semantics and can be statically
  212. typeless (or just "typeless", as in Smalltalk) where references (variables)
  213. have no type, but the objects (values) they point to always do.  An untyped
  214. pointer (such as void* in C++) and an embedded dynamic typing scheme are used
  215. in more conventional languages to fully emulate this style of dynamically typed
  216. programming (see sections 2.3, 4.3, and [Coplien 92]).
  217.  
  218. Below is a simple example to show a most trivial case of OO implementation.
  219. It is primarily intended to introduce new terms.  See [Cardelli 85] for
  220. another semantic definition of OO using functions for methods and for
  221. a view of types as sets of values.
  222.  
  223. Simple statically-typed objects (static and auto vars and temps in C++ and
  224. expanded types in Eiffel) can be viewed as instances of a record type,
  225. whose record fields are called instance variables (Smalltalk) or member data
  226. (C++).  The record (class) may also contain operations which are called
  227. methods (Smalltalk) or member functions (C++) which are equivalent to a
  228. function taking an object of the record type, called the receiver, as the
  229. first parameter.  The receiver is called self (Smalltalk) or this (C++).
  230. Members will denote both instance variables and methods.  Inheritance is
  231. roughly equivalent to a loosely coupled variant record, with derived classes
  232. as variant parts and with multiple-inheritance concatenating several records
  233. to serve as a base.
  234.  
  235. A virtual member in statically typed languages is a base class member that can
  236. be set or respecified by a derived class.  This is roughly equivalent to a
  237. pointer or function pointer in the base class being set by the derived class.
  238. [Stroustrup 90] covers the implementation details of virtual member functions
  239. in C++, which also involve an offset for the receiver to handle multiple-
  240. inheritance.  This is an example of dynamic binding, which replaces a
  241. switch statement on variant parts with a single call, reducing code size
  242. and program complexity (fewer nested programming constructs) and allowing
  243. variants to be added without modifying client code (which causes higher defect
  244. injection rates during maintanance and debugging).
  245.  
  246. Virtual members in dynamically typed languages are more flexible because
  247. static typechecking requirements are dropped.  See section 2.5.
  248.  
  249. The terms method/member function, instance variable/member data, subclass/
  250. derived class, parent class/base class, and etc. will be used interchangeably.
  251. As pointed out in [Stroustrup 90, p197], the base/derived class terminology
  252. may be preferable to the sub/super-class terminology, and is preferred in
  253. this document also.
  254.  
  255. Delegation/prototyping languages [Kim 89, ch3; Ungar 87, Sciore 89] have a more
  256. flexible kind of object which can play the role of classes in classical OO
  257. languages.  Since there is no separate class construct in these languages, and
  258. only objects, they are referred to as single-hierarchy, or 1 Level systems.
  259. Objects contain fields, methods and delegates (pseudo parents), whereas
  260. classical object-oriented languages associate method, field and parent
  261. definitions with classes (and only associate state and class with objects,
  262. although vtables of function pointers for dynamic binding is an exception).
  263. However, one-level objects often play the role of classes to take advantage of
  264. sharing and often instances will simply delegate to parents to access methods
  265. or shared state, otherwise idiosyncratic objects, a powerful and natural
  266. concept, will result.  Typical 1 Level objects can contain any number of
  267. fields, methods and parents and any object can be used as a template/exemplar,
  268. thus performing the classical role of a class.  In typical prototyping systems,
  269. parents (as any other member) can be added or changed dynamically, providing
  270. dynamic multiple inheritance (or more typically simple delegation).  Here, the
  271. term "Prototype" usually refers to prototype theory, a recent theory of
  272. classification where any object can be inherited from or cloned to serve as a
  273. prototype for newly created instances.  [The Author also uses the term for
  274. languages providing high quality support for rapid prototyping, although this
  275. usage is atypical]  See [Booch 94, pp 154-155] for a brief discussion of
  276. prototype theory in the context of OOA and OOD.
  277.  
  278. It is common in such systems for an object to "become" another kind of object
  279. by changing its parent.  A good example is a window becoming an icon, since
  280. window and icon objects display different behavior (although cognitive
  281. differences are significant too:-)  Delegation refers to delegating the
  282. search for an attribute to a delegate, and is therefore more of a pure
  283. message passing mechanism (as with dynamic scoping) than inheritance, which
  284. also typically specifies non-shared state when used for representation.
  285.  
  286. Chambers has proposed an interesting variation called "Predicate Classes"
  287. [Chambers 93] as a part of his Cecil language.  These classes will only be
  288. parents when certain predicates are true.  This can support a types/classes
  289. as collections of objects view, which is the same as the types as sets of
  290. values view taken by [Cardelli 85].  [Martin 92] provides some examples of
  291. this view applied during OOA.
  292.  
  293. 1 level systems therefore provide the most flexible and powerful capabilities.
  294. Self is a good example of a delegation-based single hierarchy language [Ungar
  295. 87].
  296.  
  297.  
  298. 1.2)  What Is Object Encapsulation (Or Protection)?
  299. ---------------------------------------------------
  300.  
  301. [Booch 91, p. 45] defines: "Encapsulation is the process of hiding all of the
  302. details of an object that do not contribute to its essential characteristics."
  303.  
  304. [Coad 91, 1.1.2] defines: "Encapsulation (Information Hiding).  A principle,
  305. used when developing an overall program structure, that each component of a 
  306. program should encapsulate or hide a single design decision...  The interface
  307. to each module is defined in such a way as to reveal as little as possible
  308. about its inner workings.  [Oxford, 1986]"
  309.  
  310. Some languages permit arbitrary access to objects and allow methods to be
  311. defined outside of a class as in conventional programming.  Simula and
  312. Object Pascal provide no protection for objects, meaning instance variables
  313. may be accessed wherever visible.  CLOS and Ada allow methods to be defined
  314. outside of a class, providing functions and procedures.  While both CLOS
  315. and Ada have packages for encapsulation, CLOS's are optional while Ada's
  316. methodology clearly specifies class-like encapsulation (Adts).
  317.  
  318. However most object-oriented languages provide a well defined interface to
  319. their objects thru classes.  C++ has a very general encapsulation/protection
  320. mechanism with public, private and protected members.  Public members (member
  321. data and member functions) may be accessed from anywhere.  A Stack's Push and
  322. Pop methods will be public.  Private members are only accessible from within
  323. a class.  A Stack's representation, such as a list or array, will usually be
  324. private.  Protected members are accessible from within a class and also from
  325. within subclasses (also called derived classes).  A Stack's representation
  326. could be declared protected allowing subclass access.  C++ also allows a
  327. class to specify friends (other (sub)classes and functions), that can access
  328. all members (its representation).  Eiffel 3.0 allows exporting access to
  329. specific classes.
  330.  
  331. For another example, Smalltalk's class instance variables are not accessible
  332. from outside of their class (they are not only private, but invisible).
  333. Smalltalk's methods are all public (can be invoked from anywhere), but a
  334. private specifier indicates methods should not be used from outside of the
  335. class.  All Smalltalk instance variables can be accessed by subclasses, 
  336. helping with abstract classes and overriding.
  337.  
  338. Another issue is per-object or per-class protection.  Per-class protection
  339. is most common (e.g. Ada, C++, Eiffel), where class methods can access any
  340. object of that class and not just the receiver.  Methods can only access the
  341. receiver in per-object protection.  This supports a subtyping model, as any
  342. object other than the receiver is only satisfying an abstract type interface,
  343. whereby no method or object structure can be inferred in the general case.
  344.  
  345.  
  346. 1.3  What Is A Class?
  347. --------------------
  348.  
  349. A class is a general term denoting classification and also has a new meaning
  350. in object-oriented methods.  Within the OO context, a class is a specification
  351. of structure (instance variables), behavior (methods), and inheritance
  352. (parents, or recursive structure and behavior) for objects.  As pointed out
  353. above, classes can also specify access permissions for clients and derived
  354. classes, visibility and member lookup resolution.  This is a feature-based or
  355. intensional definition, emphasizing a class as a descriptor/constructor of
  356. objects (as opposed to a collection of objects, as with the more classical
  357. extensional view, which may begin the analysis process).
  358.  
  359. Original Aristotlean classification defines a "class" as a generalization of
  360. objects:
  361. [Booch 91, p93]
  362.   "a group, set, or kind marked by common attributes or a common attribute; a
  363.    group division, distinction, or rating based on quality, degree of
  364.    competence, or condition".
  365.    
  366. [Booch's definition in the context of OOD]
  367.   "A class is a set of objects that share a common structure and a common
  368.   behavior."  "A single object is simply an instance of a class."
  369.  
  370. The intension of a class is its semantics and its extension is its instances
  371. [Martin 92].
  372.  
  373. [Booch 94, 4.2] proposes 3 views of classification as useful in OO analysis and
  374. design: classical categorization (common properties), conceptual clustering
  375. (conceptual descriptions), and prototype theory (resemblance to an exemplar).
  376. He advocates starting with the former approach, turning to the second approach
  377. upon unsatisfactory results, and finally the latter if the first two approaches
  378. fail to suffice.
  379.  
  380.  
  381. 1.4)  What Is A Meta-Class?
  382. ---------------------------
  383.  
  384. [See also section 1.6]
  385.  
  386. A Meta-Class is a class' class.  If a class is an object, then that object
  387. must have a class (in classical OO anyway).  Compilers provide an easy way to
  388. picture Meta-Classes.  Classes must be implemented in some way; perhaps with
  389. dictionaries for methods, instances, and parents and methods to perform all
  390. the work of being a class.  This can be declared in a class named "Meta-Class".
  391. The Meta-Class can also provide services to application programs, such as
  392. returning a set of all methods, instances or parents for review (or even
  393. modification).  [Booch 91, p 119] provides another example in Smalltalk with
  394. timers.  In Smalltalk, the situation is more complex.  To make this easy, refer
  395. to the following listing, which is based on the number of levels of distinct
  396. instantiations:
  397.  
  398. 1 Level System
  399.   All objects can be viewed as classes and all classes can be viewed as
  400.   objects (as in Self).  There is no need for Meta-Classes because objects
  401.   describe themselves.  Also called "single-hierarchy" systems.
  402.   There is only 1 kind of object.
  403. 2 Level System
  404.   All Objects are instances of a Class but Classes are not accessible to
  405.   programs (no Meta-Class except for in the compiler and perhaps for type-safe
  406.   linkage, as in C++).
  407.   There are 2 kinds of distinct objects: objects and classes.
  408. 3 Level System
  409.   All objects are instances of a class and all classes are instances of
  410.   Meta-Class.  The Meta-Class is a class and is therefore an instance of
  411.   itself (really making this a 3 1/2 Level System).  This allows classes to
  412.   be first class objects and therefore classes are available to programs.
  413.   There are 2 kinds of distinct objects (objects and classes), with a
  414.   distinguished class, the metaclass.
  415. 5 Level System
  416.   What Smalltalk provides.  Like a 3 Level System, but there is an extra level
  417.   of specialized Meta-Classes for classes.  There is still a Meta-Class as in 
  418.   a 3 Level System, but as a class it also has a specialized Meta-Class, the
  419.   "Meta-Class class" and this results in a 5 Level System: 
  420.     object
  421.     class
  422.     class class (Smalltalk's Meta-Classes)
  423.     Meta-Class
  424.     Meta-Class class
  425.  
  426.   The "class class"es handle messages to classes, such as constructors and
  427.   "new", and also "class variables" (a term from Smalltalk), which are
  428.   variables shared between all instances of a class (static member data in
  429.   C++).  There are 3 distinct kinds of objects (objects, classes, and
  430.   metaclasses).
  431.  
  432.  
  433. 1.5)  What Is The Infinite Regress Of Objects And Classes?
  434. ----------------------------------------------------------
  435.  
  436. In the authors opinion, a myth.  The story goes an object is an instance of a
  437. class (Meta-Object), a class is an instance of a Meta-Class, which must also
  438. be an instance of a Meta-Meta-Class, which must also be an instance of a Meta-
  439. Meta-Meta-Class, ...  Closure can be achieved with an instance-of loop, as with
  440. a Meta-Class being an instance of itself or with a "Meta-Class - Meta-Class
  441. class" instance-of loop (as in Smalltalk).
  442.  
  443.  
  444. 1.6)  What Are MOPs And Reflection?
  445. -----------------------------------
  446.  
  447. MOP is an acronym for Meta-Object Protocol.  This is a system with
  448. Meta-Classes accessible to users [Kiczales 92, Paepcke 93].  In CLOS
  449. terminology, an introspective protocol provides a read only capability (e.g.
  450. what is this object's class, give info on this class, etc.) and an
  451. intercessory protocol provides a write capability which allows system
  452. modification (e.g. add the following method or instance to this class,
  453. perform inheritance this way, etc.).  Because inheritance can be used to
  454. perform differential changes, intercessory protocols allow users to not
  455. only define new frameworks but to specialize existing system frameworks
  456. differentially without affecting them and their extant objects.  Thus, many
  457. frameworks can interoperate together simultaneously.  This is a good example
  458. of object-oriented reuse, since the compiler itself is reused thru
  459. specialization to provide new frameworks.
  460.  
  461. "Reflective" systems are systems with MOPs (not to be confused with reflexive
  462. systems, which often refer to systems implemented in terms of themselves, or
  463. bootstrapped).  Reflective systems are inevitably reflexive (as are most
  464. quality compilers), providing a direct program interface to the system.
  465.  
  466.  
  467. 1.7)  What Is Inheritance?
  468. --------------------------
  469.  
  470. Inheritance provides a natural classification for kinds of objects and allows
  471. for the commonality of objects to be explicitly taken advantage of in modeling
  472. and constructing object systems.  Natural means we use concepts,
  473. classification, and generalization to understand and deal with the complexities
  474. of the real world.  See the example below using computers.
  475.  
  476. Inheritance is a relationship between classes where one class is the parent
  477. (base/superclass/ancestor/etc.) class of another.  Inheritance provides
  478. programming by extension (as opposed to programming by reinvention
  479. [LaLonde 90]) and can be used as an is-a-kind-of (or is-a) relationship or
  480. for differential programming.  Inheritance can also double for assignment
  481. compatibility (see section 2.7).
  482.  
  483. In delegation languages, such as Self, inheritance is delegation where objects
  484. refer to other objects to respond to messages (environment) and do not
  485. respecify state by default.
  486.  
  487. Inherited parents can specify various flavors of state.  Delegation languages
  488. don't specify new state by default (to do so requires cloning), C-based (C++,
  489. Objective-C, etc.), lisp-based (CLOS, Flavors, Scheme, etc.), and Pascal-based
  490. (Ada-9x, Modula-3, Object Pascal, etc.) OO languages do, but with multiple-
  491. inheritance can also share parents within a class lattice (CLOS and Eiffel
  492. provide this as a default at the level of slots and features, respectively).
  493.  
  494. Inheritance also provides for member lookup, or internal environment.  Various
  495. schemes exist, for example C++ finds the closest match within a scope but
  496. causes an ambiguity error iff more than one parent has match, CLOS creates
  497. a linear precedence list, Self provides parent priorities, and Eiffel forces
  498. renaming for any parent member conflicts.
  499.  
  500. Defining inheritance (with a thorough description or denotational semantic
  501. definition, or both) can avoid confusion about which inheritance scheme is
  502. being used (especially in OOD), because inheritance has many variations and
  503. combinations of state and environment (sometimes with complex rules).
  504. Inheritance can also be used for typing, where a type or class can be used to
  505. specify required attributes of a matching object (see sections 2.1, 2.7 and
  506. [Cardelli 85]).  It would be more judicious to have discussions on how
  507. inheritance should be defined instead of over what it is, since it has many
  508. existing uses and semantics.
  509.  
  510. An example of the is-a-kind-of relationship is shown below.  Is-a is often
  511. used synonymously, but can be used to show the "object is-a class"
  512. instantiation relationship.  In classical OO, inheritance is a relationship
  513. between classes only.  In one-level systems, is-a (object instantiation) and
  514. is-a-kind-of (inheritance) are merged into one [Ungar 87, Madsen 93, Sciore
  515. 89].
  516.  
  517.                                Computer
  518.                               /    |     \
  519.                        Mainframe  Mini    Personal
  520.                         /    \    ...       /   \
  521.                   Data Proc  Scientific   PC    Workstation
  522.  
  523. Class hierarchies are subjective [Booch 91, 4.2; Lakoff 87] and usually drawn
  524. with the parent class on top, but more demanding graphs (as is often the case
  525. in [Rumbaugh 91]) allow any topology, with the head of an arrow indicating the
  526. base class and the tail indicating the derived class.
  527.  
  528. Differential programming is the use of inheritance to reuse existing classes
  529. by making a small change to a class.  Creating a subclass to alter a method
  530. or to add a method to a parent class is an example.
  531.  
  532.  
  533. 1.8)  What Is Multiple Inheritance?
  534. -----------------------------------
  535.  
  536. Multiple Inheritance occurs when a class inherits from more than one parent.
  537. For example, a person is a mammal and an intellectual_entity, and a document
  538. may be an editable_item and a kind of literature.
  539.  
  540. Mixin's is a style of MI (from flavors) where a class is created to provide
  541. additional attributes or properties to other classes.  They are intended to be
  542. inherited by any class requiring them.  Method combination, or calling
  543. sequences of before, after, and around methods or even several primary methods
  544. [Kim 89, ch 4], make good use of mixins by invoking their methods without
  545. explicitly calling them, allowing client class code to remain unchanged [Booch
  546. 91, p 113].
  547.  
  548.  
  549. 1.9)  Does Multiple Inheritance Pose Any Additional Difficulties?
  550. -----------------------------------------------------------------
  551.  
  552. Yes, it does.  Any name can be simply resolved to a class member with single
  553. inheritance by simply accessing the first name encountered for data members
  554. and by accessing the first signature match (or ambiguity) encountered for
  555. methods (at least one way, C++ hides some member functions).  Since several
  556. distinct parents can declare a member within a multiple inheritance hierarchy,
  557. which to choose becomes an issue.  Eiffel forces derived classes to rename
  558. parent members that conflict.  Self prioritizes parents.  CLOS merges member
  559. "slots" (instance variables) with the same name into a single slot, as did
  560. the earlier flavors.  C++ declares an error iff a conflict arises, but a
  561. class qualifier can be used to explicitly disambiguate.  Smalltalk renders
  562. same names for instance variables of subclasses illegal.
  563.  
  564. On the other hand, multiple-inheritance can be seen as required for basic
  565. object-oriented programming, because many objects in the real world belong to
  566. several classes.  In classical systems without MI, a class which should inherit
  567. from more than one class must textually include all but one of those classes in
  568. its interface, causing code duplication (and a messy interface).
  569.  
  570.  
  571. 1.10)  What Is Dynamic Inheritance?
  572. -----------------------------------
  573.  
  574. Dynamic inheritance allows objects to change and evolve over time.  Since base
  575. classes provide properties and attributes for objects, changing base classes
  576. changes the properties and attributes of a class.  A previous example was a
  577. window changing into an icon and then back again, which involves changing a
  578. base class between a window and icon class.
  579.  
  580. More specifically, dynamic inheritance refers to the ability to add, delete,
  581. or change parents from objects (or classes) at run-time.  Actors, CLOS, and
  582. Smalltalk provide dynamic inheritance in some form or other.  Single hierarchy
  583. systems, such as Self, provide dynamic inheritance in the form of delegation
  584. [Ungar 87].
  585.  
  586. See also [Kim 89, chs 1, 3] for a discussion and [Coplien 92] for some
  587. implementation discussion in C++.
  588.  
  589.  
  590. 1.11)  What Is Shared (Repeated) Inheritance?
  591. ---------------------------------------------
  592.  
  593. Multiple Inheritance brings up the possibility for a class to appear as a
  594. parent more than once in a class graph (repeated inheritance), and there is
  595. then a potential to share that class.  Only one instance of the class will
  596. then appear in the graph (as is always the case in CLOS, because all *members*
  597. with the same name will be shared (receive a single slot) with the greatest
  598. common subtype as its type).  C++ provides an alternative, where only parents
  599. specified as virtual (virtual bases) are shared within the same class lattice,
  600. allowing both shared and non-shared occurrences of a parent to coexist.  All
  601. "features" in Eiffel (C++ members) of a repeated parent that are not to be
  602. shared must be renamed "along an inheritance path", else they are shared by
  603. default.  This allows a finer granularity of control and consistent name
  604. resolution but requires more work for parents with many features.
  605.  
  606.  
  607. 1.12)  Why Use Inheritance?
  608. ---------------------------
  609.  
  610. Inheritance is a natural way to model the world or a domain of discourse,
  611. and so provides a natural model for OOA and OOD (and even OOP).  This is
  612. common in the AI domain, where semantic nets use inheritance to understand
  613. the world by using classes and concepts for generalization and categorization,
  614. by reducing the real-world's inherent complexity.
  615.  
  616. Inheritance also provides for code and structural reuse.  In the above Computer
  617. class diagram, all routines and structure available in class Computer are
  618. available to all subclasses throughout the diagram.  All attributes available
  619. in Personal computers are also available to all of its subclasses.  This kind
  620. of reuse takes advantage of the is-a-kind-of relationship.  Class libraries
  621. also allow reuse between applications, potentially allowing order-of-magnitude
  622. increases in productivity and reductions in defect rates (program errors),
  623. as library classes have already been tested and further use provides further
  624. testing providing even greater reliability.
  625.  
  626. With differential programming, a class does not have to be modified if it is
  627. close to what's required; a derived class can be created to specialize it.
  628. This avoids code redundancy, since code would have to be copied and modified
  629. otherwise.  See [Raj 89] for an alternative approach as found in Jade.
  630.  
  631. Polymorphism is often explicitly available in many OO languages (such as C++,
  632. CLOS, Eiffel, etc.) based on inheritance when type and class are bound together
  633. (typing based on subclassing, or subclass polymorphism), since only an object
  634. which is a member of (inherits from) a class is polymorphically assignment
  635. compatible with (can be used in place of) instances or references of that
  636. class.  Such assignment can result in the loss of an object's dynamic type in
  637. favor of a static type (or even loss of an object's representation to that of
  638. the static class, as in C++ slicing).  Maintaining the dynamic type of objects
  639. can be provided (and preferred); however, C++ provides both sliced and non-
  640. sliced replacement in a statically typed environment (see section 2.1).
  641.  
  642.  
  643. 1.13)  Why Don't Some People Like Inheritance?
  644. ----------------------------------------------
  645.  
  646. Some people complain that inheritance is hierarchical (which is what most
  647. object-oriented languages provide).  They would also like to see more
  648. operations available (set operations are quite common in specialized systems).
  649. The former is a kind of language dependent feature commonly found in object-
  650. oriented languages which are then associated with the term "inheritance"
  651. (although they don't need to be.  For example, delegation languages allow graph
  652. inheritance stuctures).  Some don't like the coupling of classes (as in Jade),
  653. but in the author's opinion many of their complaints are easily answered.  In
  654. systems that provide inheritance, inheritance provides a simple and elegant way
  655. to reuse code and to model the real world in a meaningful way.
  656.  
  657. Others complain multiple inheritance is too complicated because it brings up
  658. the issues of shared bases and member conflict resolution.  But most modern
  659. systems support Multiple Inheritance by employing semantic resolution
  660. strategies or renaming, and most consider MI to be highly desirable.  See the
  661. latter part of section 1.9 for an example of why MI is important.
  662.  
  663. Some prefer association to MI, claiming "roles" (as defined in [Rumbaugh 91])
  664. should be associations and inheritance should be reserved for a single
  665. hierarchy "creation" mechanism, however this loses polymorphism and loses the
  666. use of inheritance for typical classification.  Representation "roles" can be
  667. supported by dynamic multiple inheritance (DMI) in many situations.
  668.  
  669.  
  670. 1.14)  What Is Specialization/Generalization/Overriding?
  671. --------------------------------------------------------
  672.  
  673. To create a subclass is specialization, to factor out common parts of
  674. derived classes into a common base (or parent) is generalization [Booch 91,
  675. p56].  Overriding is the term used in Smalltalk and C++ for redefining a
  676. (virtual in Simula and C++) method in a derived class, thus providing
  677. specialized behavior.  All routines in Smalltalk are overridable and non-
  678. "frozen" features in Eiffel can be "redefined" in a derived class.  Whenever
  679. a method is invoked on an object of the base class, the derived class method
  680. is executed overriding the base class method, if any.  Overriding in Simula
  681. is a combination of overloading and multiple-polymorphism because parameters do
  682. not have to be declared.  Eiffel and BETA are examples of languages allowing
  683. any member to be redefined and not just methods, as is typical.
  684.  
  685.  
  686. 1.15)  What Is The Difference Between Object-Based And Object-Oriented?
  687. -----------------------------------------------------------------------
  688.  
  689. Object-Based Programming usually refers to objects without inheritance
  690. [Cardelli 85] and hence without polymorphism, as in '83 Ada and Modula-2.
  691. These languages support abstract data types (Adts) and not classes, which
  692. provide inheritance and polymorphism.  Ada-9x and Modula-3; however, support
  693. both inheritance and polymorphism and are object-oriented.  [Cardelli 85, p481]
  694. state "that a language is object-oriented if and only if it satisfies the
  695. following requirements:
  696.  
  697.   - It supports objects that are data abstractions with an interface of named
  698.     operations and a hidden local state.
  699.   - Objects have an associated type.
  700.   - Types may inherit attributes from supertypes.
  701.  
  702.   object-oriented = data abstractions + object types + type inheritance
  703.  
  704. These definitions are also found in [Booch 91, Ch2 and Wegner 87].
  705.  
  706. [Coad 91] provides another model:
  707.  
  708.   Object-Oriented = Classes and Objects 
  709.                     + Inheritance 
  710.                     + Communication with messages
  711.  
  712. Stroustrup's first edition of [Stroustrup 91, '86 p. 37] defines object based
  713. as: "... storing type identification in each object, brings us to a style of
  714. programming often referred to as "object based"", which is quite different
  715. from C+W's.
  716.  
  717. A more modern definition of "object-oriented" includes single-hierarchy
  718. languages and perhaps object id's for unique objects.  Object id's support the
  719. modern notion of relocatable, persistent and distributed objects that can
  720. even migrate across machines.  Distributed Smalltalk's proxy objects [Kim 89,
  721. ch 19 and Yaoqing 93] provide another example of a distributable and migratable
  722. object facility.  Separate type system support is another extension.
  723.  
  724. [Booch 94, 2.2] proposes 7 "Elements of the Object Model"; 4 major and 3 minor:
  725.   Major:
  726.     Abstraction
  727.     Encapsulation
  728.     Modularity
  729.     Hierarchy  (Inheritance)
  730.   Minor:
  731.     Typing
  732.     Concurrency
  733.     Persistence
  734.  
  735.  
  736. 1.16)  Is A Class An Object?
  737. ----------------------------
  738.  
  739. In C++ no, because C++ classes are not instances of an accessible class (a
  740. Meta-Class) and because C++ classes are not accessible to programs.  Classes
  741. are objects in 3 Level Systems and above because classes are instances of
  742. meta-classes.  But classes play a dual role, because objects can only be
  743. declared to be instances of a class (and class objects instances of a
  744. meta-class).  In 1 Level (single-hierarchy) systems, all classes are objects.
  745.  
  746.  
  747. 1.17)  Is An Object A Class?
  748. ----------------------------
  749.  
  750. In a Level 3 System and above yes, but only instances of a Meta-Class are
  751. Classes.  Instances of a Class (ordinary objects) are not classes (excluding
  752. hybrid systems).  However, all objects may be classes in single hierarchy
  753. systems, since any object may act as a class (provide object instantiation or
  754. act as a shared parent).
  755.  
  756.  
  757. 1.18)  What Is A Method? (And Receiver And Message)
  758. ---------------------------------------------------
  759.  
  760. A method implements behavior, which is defined by [Booch 91, p80]:
  761.  
  762.   Behavior is how an object acts and reacts, in terms of its state changes
  763.   and message passing.
  764.  
  765. A method is a function or procedure which is defined in a class and typically
  766. can access the internal state of an object of that class to perform some
  767. operation.  It can be thought of as a procedure with the first parameter as
  768. the object to work on.  This object is called the receiver, which is the object
  769. the method operates on.  An exception exists with C++'s static member functions
  770. which do not have a receiver, or "this" pointer.  The following are some common
  771. notations for invoking a method, and this invocation can be called a message
  772. (or message passing, see below):
  773.  
  774.   receiver.message_name(a1, a2, a3)   
  775.   receiver message_name: a1 parm1: a2 parm3: a3
  776.  
  777. Selector would be another good choice for message_name in the above examples,
  778. although keywords (or formal parameter names, like named parameters) are
  779. considered part of the selector in Smalltalk (and hence Objective-C).
  780.  
  781. If done statically, this can be referred to as invocation, and message passing
  782. if done dynamically (true dynamic binding).  Statically typed dynamic binding
  783. (e.g. C++ and Eiffel) is really in between (checked function pointers).
  784.  
  785. See also section 1.19 below for a discussion on the functional (prefix) verses
  786. message based (receiver based) notation.
  787.  
  788.  
  789. 1.19)  What Are Multi-Methods And Multiple-Polymorphism?
  790. --------------------------------------------------------
  791.  
  792. Multi-methods involve two primary concepts, multiple-polymorphism and lack of
  793. encapsulation.  These issues are orthogonal.  Multiple-polymorphism implies
  794. more than one parameter can be used in the selection of a method.  Lack of
  795. encapsulation implies all arguments can be accessed by a multi-method (although
  796. packages can be used to restrict access, as in CLOS).  Multi-methods can also
  797. imply a functional prefix notation, although the CLOS designers (who coined the
  798. term "multi-method") consider the functional and receiver based forms
  799. (messages) equivalent.  Functional syntax was chosen "in order to minimize the
  800. number of new mechanisms added to COMMON LISP" [Kim ch 4, p70 (D. Moon)].
  801. [Chambers 93] discusses multi-methods in his new OO language, Cecil.
  802.  
  803. Multiple-polymorphism allows specialized functions or methods to be defined to
  804. handle various cases:
  805.  
  806.   +(int, int)
  807.   +(int, float)
  808.   +(int, complex)
  809.   +(int, real)
  810.   +(float, complex)
  811.   +(float, real)
  812.   +(float, float)
  813.  
  814. The above functions are specialized to each of the cases required allowing
  815. single, highly cohesive and loosely coupled functions to be defined.  This is
  816. also the true essence of object-oriented polymorphism, which allows objects to
  817. define methods for each specific case desired.  In addition to better coupling
  818. and cohesion, multiple-polymorphism reduces program complexity by avoiding
  819. coding logic (switch statements) and because small methods further reduce
  820. complexity, as code complexity doesn't grow linearly with lines of code per
  821. method, but perhaps exponentially.  This should be distinguished from double
  822. dispatch, a fancy name for single dispatch after a call, which only provides
  823. switching on a single argument per call (but for 2 levels), consistently
  824. ignoring the inherent type of parameters in messaging.  Double dispatch is
  825. used in languages with static typing for simplicity and efficiency
  826. considerations.
  827.  
  828. If all of the above types are Numbers, code can be written without concern for
  829. the actual classes of objects present:
  830.  
  831.   fn(one, two: Number): Number
  832.     return one + two;
  833.  
  834. The addition expression above will invoke the correct "+" function based on the
  835. inherent (true, actual, or dynamic) types of one and two.  Only the inherent
  836. type of "one" would be used with double dispatch!  In the author's opinion,
  837. this is a serious shortcoming.  Further, double dispatch would only allow
  838. switching to the "fn" function based on the type of "one" also.  This could
  839. lead to the use of switch statements based on type or complex coding in many
  840. real-world programming situations, unnecessarily.  In the author's opinion,
  841. this should only be used as necessary, e.g. if the implementation language
  842. doesn't support multiple-polymorphism and either efficiency considerations
  843. dominate and double dispatch can be suffered, or an embedded dynamic typing
  844. scheme is used.
  845.  
  846. Why do multi-methods allow open access to parameters?  It allows efficient
  847. handling, like C++ friends, usually by allowing representation details of more
  848. than one object to be exposed.  See [Kim ch 4, pp70-71 (D. Moon)] for an
  849. alternative explanation.  While open access can be useful in some cases, it
  850. typically isn't recommended as a general OO practice (see section 1.15, C+W's
  851. requirement 1 for OO languages and Section 1.2 on Encapsulation) and also
  852. violates subtype polymorphism, because only subclass polymorphism is based on
  853. representation and not type.
  854.  
  855. Polymorphic languages can be statically typed to provide strong type checking,
  856. efficiency, and to support a static programming idiom, but require restrictions
  857. in many cases, such as requiring overriding methods to have identical
  858. signatures with the methods they substitute (as in C++) or allowing covariant
  859. parameters but limiting base class usage (as in Eiffel).  If these restrictions
  860. are dropped, multiple-polymorphism results.  Thus a single overridable function
  861. declared in a base class may have several functions overriding it in a derived
  862. class differentiated only by their formal argument types.  This therefore
  863. requires both static and dynamic typing, because no formal argument
  864. differentiation is possible without static types, as in Smalltalk, and no
  865. actual argument differentiation is possible without dynamic types (as in C++
  866. and Eiffel).  See section 2.3 for another example of multiple-polymorphism.
  867.  
  868. There is some concern about the efficiency of run-time method selection as
  869. can occur with multiple-polymorphism (or even dynamic message passing).
  870. However, static analysis optimizations are commonly available in the
  871. literature, potentially providing a single static selection in many cases
  872. [See Agrawal 91, Chambers 92, Mugridge 91, and etc.].
  873.  
  874. But coupling the two cases of selector variables (as found in CLOS,
  875. Objective-C, and etc.) and several possible known selectors together with the
  876. general undecidability of dynamic types at compile-time renders dynamic typing
  877. and run-time selection (or checking) as unavoidable in the general case [a
  878. point often mistaken in comp.object.  E.g. simple statically/strongly typed
  879. multi-methods still require dynamic types!]
  880.  
  881. See [Booch 91], multiple-polymorphism, for a good CLOS example.
  882.  
  883.  
  884. 1.20)  What Is OOP?
  885. -------------------
  886.  
  887. OOP stands for Object-Oriented Programming, the usual programming/hacking and
  888. etc. most programmers think of.  Modern software engineering methodologies;
  889. however, consider OOP as the implementation/evolution of an OOD.
  890.  
  891.  
  892. 1.21)  What Is OOA/OOD (And Where Can I Get What I Need On It)?
  893. ---------------------------------------------------------------
  894.  
  895.   See also section 3.7, the Annotated Bibliography, and APPENDIX D.  The
  896.   classified bibliography in [Booch 94] also contains entries on OOA(B), OOD(F)
  897.   and OOP(G).
  898.  
  899. [Booch 91]
  900.   "In OOA, we seek to model the world by identifying the classes and objects
  901.   that form the vocabulary of the problem domain, and in OOD, we invent the
  902.   abstractions and mechanisms that provide the behavior that this model
  903.   requires."
  904.  
  905. [Coad 91]
  906.   "OOA is the challenge of understanding the problem domain, and then the
  907.   system's responsibilities in that light".
  908.   "To us, analysis is the study of a problem domain, leading to a specification
  909.   of externally observable behavior; a complete, consistent, and feasible
  910.   statement of what is needed; a coverage of both functional and quantified
  911.   operational characteristics (e.g. reliability, availability, performance)".
  912.   "Design.  The practise of taking a specification of externally available
  913.   behavior and adding details needed for actual computer system implementation,
  914.   including human interaction, task management, and data management details."
  915.  
  916. And on Domain Analysis:
  917.  
  918.   "Whereas OOA typically focuses upon one specific problem at a time, domain
  919.    analysis seeks to identify the classes and objects that are common to all
  920.    applications within a given domain, [...]".  - [Booch 91]
  921.  
  922.   [The following quotes on domain analysis are from [Berard 93]]
  923.  
  924.   "An investigation of a specific application area that seeks to identify the
  925.    operations, objects, and structures that commonly occur in software systems
  926.    within this area.  - Dan McNicholl
  927.  
  928.   "Systems analysis states what is done for a specific problem in a domain
  929.    while domain analysis states what can be done in a range of problems in a
  930.    domain.  ...A domain analysis is only useful in many similar systems are to
  931.    be built so that the cost of the domain analysis can be amortized over the
  932.    cost of all the systems.
  933.  
  934.    The key to reusable software is captured in domain analysis in that it
  935.    stresses the reusability of analysis and design, not code. - Jim Neighbors
  936.  
  937.   "The process of identifying, collecting, organizing, and representing the
  938.   relevant information in a domain based on the study of existing systems and
  939.   their development histories, knowledge captured from domain experts,
  940.   underlying theory, and emerging technology within the domain."  - Kang et al.
  941.  
  942.   Object-oriented domain analysis (OODA) seeks to identify reusable items
  943.   localized around objects, e.g., classes, instances, systems of interacting
  944.   objects, and kits [frameworks]. OORA analysts and OOD designers will
  945.   interact on a fairly frequent basis with the domain analysis effort.
  946.  
  947.  
  948. OOA and OOD stand for Object-Oriented Analysis and Object-Oriented Design,
  949. respectively.  OOA strives to understand and model, in terms of object-oriented
  950. concepts (objects and classes), a particular problem within a problem domain
  951. (from its requirements, domain and environment) from a user-oriented or domain
  952. expert's perspective and with an emphasis on modeling the real-world (the
  953. system and its context/(user-)environment).  The product, or resultant model,
  954. of OOA specifies a complete system and a complete set of requirements and
  955. external interface of the system to be built, often obtained from a domain
  956. model (e.g. FUSION), scenarios (Rumbaugh), or use-cases (Jacobson).
  957.  
  958. [Shlaer 88] is often credited as the first book on OOA, although their method
  959. adds OO techniques to the traditional structured analysis principles of Yourdon
  960. and Constantine. Their complete approach ([Shlaer 88, 92]) consists of
  961. information modeling and recursive design, or OOA/RD and represents a recent
  962. addition to the structured analysis family (as does Martin and Odell).
  963. [Yourdon 92] provides a critique, although may only refer to their earlier
  964. work.  Many other methodologies including Rumbaugh's OMT, Martin and Odell's
  965. OOA/D, and many others, also share common ground with SA and other existing
  966. analysis methodologies with such constructs as associations (E-R), functional
  967. models, and even DFD's.  Booch, Jacobson, and Wirfs-Brock are examples of OO
  968. methodologies representing a greater departure from the conventional
  969. "structured" techniques, with greater emphasis on objects.  OOram [Reenskaug
  970. 91] provides support and emphasis on types and roles as guiding principles,
  971. which is quite powerful.  [Booch 94] presents a methodology which is an
  972. evolutionary step beyond the first edition by incorporating a collection of the
  973. best features from several of the major OO methodologies, as does HP's new
  974. FUSION methodology.
  975.  
  976. The usual progression is from OOA to OOD to OOP (implementation) and this
  977. Universal Process Model roughly corresponds to the Waterfall Model [Royce 70].
  978. See [Humphrey 89] and [Yourdon 92] for a few of many discussions on software
  979. life-cycle models and their use.  Humphrey also details Worldy and Atomic
  980. Process Models for finer grained analysis and design in the Defined Process
  981. (see below) and discusses other alternatives to the task oriented models.  He
  982. also provides the following critisisms on the Waterfall Model which had led to
  983. Boehm's seminal work on the Spiral Model:
  984.  
  985.   * It does not adequately address changes
  986.   * It assumes a relatively uniform and orderly sequence of development steps
  987.   * It does not provide for such methods as rapid prototyping or advanced
  988.     languages
  989.  
  990. Modern OO methodologies directly address these points and emphasize the
  991. incremental, iterative, evolutionary, concurrent and situational nature of
  992. software development.  [Boehm 86] presents a seminal spiral life-cycle model
  993. with a risk-driven incremental prototyping approach.  [Booch 91, 6.1]
  994. proposes a "round-trip gestalt" design with analyze-design iterations and
  995. an overall system perspective and [Berard 93] proposes an (incremental)
  996. "parallel-recursive design" with analyze-design-implement-test iterations.
  997. [Coad 91b] presents the following development cycle breakdown:
  998.  
  999.   Waterfall-
  1000.     Analysis
  1001.     Design
  1002.     Programming
  1003.  
  1004.   Spiral-
  1005.     Analysis, prototyping, risk management
  1006.     Design, prototyping, risk management
  1007.     Programming, prototyping, risk management
  1008.     [Boehm, 1988]  
  1009.  
  1010.   Incremental-
  1011.     A little analysis
  1012.     A little design
  1013.     A little programming
  1014.     Repeat
  1015.     [Gilb, 1988]
  1016.  
  1017. [Author's note: The spiral model is often incremental and may waterfall if
  1018.  called for.]
  1019.  
  1020. Since classes and objects are used in all phases of the OO software life-cycle,
  1021. the process is often referred to as seamless, meaning there is no conceptual
  1022. gap between the phases as is often the case in other software development
  1023. methodologies, such as the analysis (DFD's) to design (structure charts) to
  1024. programming gaps found in traditional structured analysis and design.
  1025. Seamlessness together with naturalness is a big advantage for consistency.
  1026.  
  1027. A problem domain has many realizations, or differing OOAs.  An OOA has many
  1028. realizations, or differing OODs, but a similar notation is often used for
  1029. the two.  An OOD also has many realizations, or differing OOPs, but allows a
  1030. selection from among various languages for implementation (choosing the best
  1031. language to implement the design).  But some, such as Bjarne Stroustrup, don't
  1032. like OOA and OOD getting too far from OOP (implementation independent), for
  1033. fear that great discrepancies could occur between OOD and OOP by losing sight
  1034. of the implementation language, which in some cases is predetermined.  See also
  1035. [Stroustrup 91].
  1036.  
  1037. From a greater perspective, the SEI has developed the Capability Maturity Model
  1038. (CMM), a process-based TQM model for assessing the level of an organization's
  1039. software development and which is often required of government contractors
  1040. in the US [Humphrey 89].  The CMM also serves as a 5 level improvement process
  1041. by specifying steps for organizations to progress to the next level, ultimately
  1042. leading to statistical (process) control and sustained improvement.  Watts S.
  1043. Humphrey is now working on the Personal Software Process (PSP), a scaled down
  1044. version of the CMM for individuals to use (references are forthcoming).  Next
  1045. should follow a team-based software process (TSP?).  Other CMM's in the works
  1046. at the SEI include a personnel management CMM (PM-CMM).
  1047.  
  1048.  Level 1: Initial:    Every project is handled differently; ad hoc and chaotic.
  1049.  Level 2: Repeatable: Every project is handled similarly.
  1050.  Level 3: Defined:    Standard processes are defined and used for all projects.
  1051.  Level 4: Managed:    A measurable basis for all improvements to the process.
  1052.  Level 5: Optimizing: Emphasis on defect prevention and optimizing/continually
  1053.                       improving the process.
  1054.  
  1055. See also:
  1056. Kitson, D.H. and Masters, S. "An Analysis of SEI Software Process Assessment
  1057. Results 1987-1991", CMU/SEI-92-TR-24
  1058.  
  1059. Humphrey, W., Snyder, T. and Willis, R. "Software Process Improvement at
  1060. Hughes Aircraft", IEEE Software, July 1991
  1061.  
  1062. Dion, R., "Elements of a Process Improvement Program," IEEE Software, July
  1063. 1992.
  1064.  
  1065. "Concepts on Measuring the Benefits of Software Process Improvement,"
  1066. CMU/SEI-93-TR-9.
  1067.  
  1068. See also [Yourdon 92], [Wilkie 93], and [Booch 94] for discussions on this
  1069. often cited model.  There is also an ISO 9000 (9001,9003) standard on software
  1070. quality and ami working group in Europe creating the SPICE standard (among
  1071. other work), which is similar in scope to the CMM.  To join the ami mailing
  1072. list email to:
  1073.   ami-request@aut.alcatel.at 
  1074. with the following message: 
  1075.   subscribe firstname, lastname, e-mail address.
  1076.  
  1077. Object-oriented analysis now includes "Enterprise Modeling" [Martin 92], also
  1078. found in [Jacobson 92], and along with recent business "reengineering" efforts
  1079. places information systems within an organizational perspective by modeling
  1080. entire organizations or a large part of them, with the information processing
  1081. system and software products development as integrated components.  [Yourdon
  1082. 92] even calls for "global modeling"!
  1083.  
  1084.  
  1085. 1.22)  Where Did Object-Orientation Come From?
  1086. ----------------------------------------------
  1087.  
  1088. Simula was the first object-oriented language providing objects, classes,
  1089. inheritance, and dynamic typing in 1967 (in addition to its Algol-60 subset).
  1090. It was intended as a conveyance of object-oriented design.  Simula 1 was a
  1091. simulation language, and the later general-purpose language Simula 67 is now
  1092. referred to as simply Simula.  Smalltalk was the next major contributor
  1093. including classes, inheritance, a high-powered graphical environment and a
  1094. powerful dynamic typing mechanism (although these existed to some extent in
  1095. Simula).  Self is somewhat of a Smalltalk-based next generation language, as is
  1096. BETA a followup to Simula (by its original designers).
  1097.  
  1098. [Meyer 88] contains a brief summary and history of Simula and Smalltalk, among
  1099. other OO languages.
  1100.  
  1101.  
  1102. 1.23)  What Are The Benefits Of Object-Orientation?
  1103. ---------------------------------------------------
  1104.  
  1105. Reuse, quality, an emphasis on modeling the real world (or a "stronger
  1106. equivalence" with the RW than other methodologies), a consistent and seamless
  1107. OOA/OOD/OOP package, naturalness (our "object concept"), resistance to change,
  1108. encapsulation and abstraction (higher cohesion/lower coupling), and etc.
  1109.  
  1110. On resistance to change, system objects change infrequently while processes
  1111. and procedures (top-down) are fequently changed, providing object-oriented
  1112. systems with more resilient system organization.
  1113.  
  1114. [Harmon 93]:
  1115.   Faster development
  1116.   Increased Quality
  1117.   Easier maintenance
  1118.   Enhanced modifiability
  1119.  
  1120. [Booch 94]:
  1121.   Exploit power of OOPs
  1122.   Reuse of software and designs, frameworks
  1123.   Systems more change resilient, evolvable
  1124.   Reduced development risks for complex systems, integration spread out
  1125.   Appeals to human cognition, naturalness
  1126.  
  1127.  
  1128. 1.24)  What Other FAQs Are Available?
  1129. -------------------------------------
  1130.  
  1131. FAQ's are cross-posted to news.answers and are archived on anonymous ftp from:
  1132.  
  1133.   rtfm.mit.edu:/pub/usenet        (also usenet-by-hierarchy, etc.)
  1134.  
  1135. rtfm archives several FAQs pertinent to OO (alternative/original sites are listed).
  1136.  
  1137.   comp.lang.ada         ajpo.sei.cmu.edu:public/comp-lang-ada/cla-faq[12]
  1138.   comp.lang.beta        daimi.aau.dk:pub/beta/beta-language-faq.txt
  1139.   comp.lang.c++         sun.soe.clarkson.edu:pub/C++/FAQ [128.153.12.3]
  1140.   comp.lang.clos
  1141.   comp.lang.eiffel      ftp.cm.cf.ac.uk:/pub/eiffel/eiffel-faq
  1142.   comp.lang.modula3
  1143.   comp.lang.oberon
  1144.   comp.lang.objective-c
  1145.   comp.lang.sather      ftp.ICSI.Berkeley.EDU:pub/sather [not on rtfm]
  1146.   comp.lang.scheme      ftp.think.com:/public/think/lisp/scheme-faq.text
  1147.   comp.lang.smalltalk   xcf.Berkeley.EDU:misc/smalltalk/FAQ/SmalltalkFAQ.entire
  1148.   comp.object           zaphod.uchicago.edu:/pub/CompObj6.faq(.Z)
  1149.   comp.object.logic     ftp.cs.cmu.edu:(2)prg_1.faq,prg_2.faq  [128.2.206.173]
  1150.   comp.software-eng
  1151.  
  1152. Notes:
  1153.   1) xcf.Berkeley.EDU is 128.32.138.1
  1154.   2) /afs/cs.cmu.edu/project/ai-repository/ai/pubs/faqs/prolog/
  1155.   3) Beta FAQ www: http://www.daimi.aau.dk/~beta/beta-language-faq.html
  1156.      most current.  Email: info@mjolner.dk with body: send BETA beta-faq
  1157.   4) Modula-3: ftp.vlsi.polymtl.ca:pub/m3/m3-faq.ps.
  1158.                http://froh.vlsi.polymtl.ca/m3/m3-faq.html.
  1159.      Archives: gatekeeper.dec.com:pub/DEC/Modula-3/comp.lang.modula3
  1160.      Newsgroup relay mailing list; message to m3-request@src.dec.com
  1161.